/*
if (typeof newsletter_check !== "function") {
    window.newsletter_check = function (f) {

	var re = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-]{1,})+\.)+([a-zA-Z0-9]{2,})+$/;
	if (!re.test(f.elements["ne"].value)) {
		alert("The email is not correct");
		return false;
	}
	if (f.elements["ny"] && !f.elements["ny"].checked) {
		alert("You must accept the privacy statement");
		return false;
	}
	var firstName = "";
	var Myemail  = document.getElementById('ne').value;
	jQuery.ajax({
			  type: "POST",
			  url: siteUrl+"/wp-content/plugins/newsletter/do/subscribe.php",
			  data: { name: "John", nn:firstName,ne: Myemail }
			})
			  .done(function( msg ) {				
			  jQuery('#success-newsltter').modal();			
		      });

	   return false;
	 }

}
*/
var options_subscribe = {
    //target: '#listImgUp', //Div tag where content info will be loaded in
    url: templateUrl+"/ajax/subscribe_user.php", //The php file that handles the file that is uploaded
    beforeSubmit: function() {
	//load progress img when uploading happens
	jQuery('.progress-bar').html('<img src="'+templateUrl+'/images/progress_bar.gif" border="0"/>');
    },
    success: function(data) {

	var message = data.split(';');
	if (message[0] == 'error') {
	    jQuery('#status-subscribe').html("<div class='alert alert-danger'>" + message[1] + "</div>");
	} else {
	    jQuery('#status-subscribe').html("<div class='alert alert-success'>" + message[1] + "</div>");
	}
	jQuery('.progress-bar').html('');
    }
};
jQuery('#form_subscribe').submit(function() {
    jQuery(this).ajaxSubmit(options_subscribe);
    return false;
});